home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
prodpack.zip
/
DB4PPSAM.EXE
/
OPENFIVL.PRG
< prev
next >
Wrap
Text File
|
1993-05-04
|
4KB
|
105 lines
FUNCTION OpenFiVl
PARAMETER pcObj
*----------------------------------------------------------------------------
* NAME
*
* DESCRIPTION
*
*----------------------------------------------------------------------------
PRIVATE lOk, nCurrId, nSParen, nEParen, nLenCs, cNewVal, cPrevCs, cErrMsg,;
nId
lOk = .T.
*--------------------------------------------------------
*-- Exit back to designer if the dialog box is not active
*--------------------------------------------------------
IF TYPE( "WM_PAINT" ) <> "N"
RETURN .t.
ENDIF
DO CASE
CASE pcObj = "CS_FILE_1"
*---------------------------------------------------------
*-- Repaint the combo's list box based on the new wildcard
*---------------------------------------------------------
IF '?' $ CS_FILE_1 .OR. '*' $ CS_FILE_1
DO TCombo WITH WM_PAINT, CB_SHOWDRO, nCurrent
ENDIF
CASE pcObj = "CL_TYPE_1"
*---------------------------------------------------------------
*-- Check to see if the user changed the value and return if not
*---------------------------------------------------------------
IF TYPE( "sCL_TYPE_1" ) = "C" .AND. sCL_TYPE_1 = CL_TYPE_1
RELEASE sCL_TYPE_1
RETURN .t.
ENDIF
*------------------------------------------------------
*-- Update the CS_FILE_1 field with the selected option
*------------------------------------------------------
nCurrId = GetId( "CS_FILE_1" ) && Id pointer to CS_FILE_1
*---------------------------------------------------------------------
*-- Build the entry field value from the file spec in the selected bar
*---------------------------------------------------------------------
nSParen = AT( "(", cl_type_1 )
nEParen = AT( ")", cl_type_1 )
cNewVal = SUBSTR( cl_type_1, nSParen + 1, nEParen - nSParen - 1 )
cPrevCs = CS_FILE_1
CS_FILE_1 = cNewVal
nLenCS = aClkObj[ 1, 3 ] - aClkObj[ 1, 2 ] + 1
CS_FILE_1 = LEFT( CS_FILE_1 + SPACE( nLenCS ), nLenCS )
*---------------------------------------
*-- Paint the new value into the control
*---------------------------------------
DO TEdit WITH WM_PAINT, EN_KILLFOC, nCurrId
DO TList WITH WM_PAINT, WM_DRAWITEM, nCurrId
nCS_FILE = 0
CASE pcObj = "BT_OK"
IF "?" $ cs_file_1 .OR. "*" $ cs_file_1 .OR. "<" $ cs_file_1
*----------------------------------------------------
*-- Set the not ok to exit flag and display a message
*----------------------------------------------------
nMess = 0 && Reset value from DLN_OK to stay in
lOk = .F.
nId = GetId( "BT_OK" )
cErrMsg = aClkObj[ aObjPoint[ nId ], 13 ]
DO _Err_Box WITH cErrMsg
*---------------------------------------------------------------------
*-- Force the display of the OK button back to the default look.
*-- Because we designed this for to have the OK button as the default,
*-- we know that the OK button is at position nDlgDef.
*---------------------------------------------------------------------
DO TButton WITH WM_PAINT, BN_DEFAULT, nDlgDef
*-------------------------------------------------------------
*-- Go back to the control where the exit attempt occurred and
*-- unhighlight the control and its label.
*-------------------------------------------------------------
IF LEFT( aClkObj[ aObjPoint[ nCurrent ], 11 ], 3 ) $ "RB_,CK_"
DO TButton WITH WM_PAINT, BN_UNHILITE, nCurrent
ELSE
DO HasTitle WITH nCurrent, BN_UNHILITE
ENDIF
*----------------------------------------------------------------
*-- Finally, position back to the CS_FILE_1 field and setup the
*-- nCurrent and nCurrGrp values to have GETMESS set focus on it.
*----------------------------------------------------------------
nId = GetId( "CS_FILE_1" )
nCurrent = nId
nCurrGrp = aClkObj[ aObjPoint[ nId ], 5 ]
DO HasTitle WITH nCurrent, BN_HILITE
ENDIF
ENDCASE
RETURN( lOk )
*-- EOF: OpenFiVl()